package com.githan.bootsecurity.controller;

import com.alibaba.fastjson.JSON;
import com.githan.bootsecurity.entity.SysRole;
import com.githan.bootsecurity.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author https://github.com/Han56
 * @date 2021/4/10 10:48
 */
@RestController
public class SysRoleController {
    @Autowired
    SysRoleService sysRoleService;

    @GetMapping("/SysRole")
    public String sysRole(){
        List<SysRole> testList=sysRoleService.getAllRolesInfo();
        String return_json= JSON.toJSONString(testList);
        System.out.println("用户角色信息打印测试:"+return_json);
        return return_json;
    }
}
